/*
 * Copyright (C) 2014 Realtek Semiconductor Corp.
 * All Rights Reserved.
 *
 * This program is the proprietary software of Realtek Semiconductor
 * Corporation and/or its licensors, and only be used, duplicated,
 * modified or distributed under the authorized license from Realtek.
 *
 * ANY USE OF THE SOFTWARE OTHER THAN AS AUTHORIZED UNDER
 * THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED.
 *
 */


#include "app_basic.h"

MIB_TABLE_INFO_T gMibRTPProfileDataTableInfo;
MIB_ATTR_INFO_T  gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_ATTR_NUM];
MIB_TABLE_RTPPROFILEDATA_T gMibRTPProfileDataDefRow;
MIB_TABLE_OPER_T gMibRTPProfileDataOper;

GOS_ERROR_CODE RTPProfileDataDrvCfg(void* pOldRow, void* pNewRow, MIB_OPERA_TYPE operationType, MIB_ATTRS_SET attrSet, UINT32 pri)
{
	//MIB_TABLE_INDEX     tableIndex = MIB_TABLE_RTPPROFILEDATA_INDEX;
	//MIB_TABLE_RTPPROFILEDATA_T *pMibRtpProfileData;
    // read out the instanceID
	//pMibRtpProfileData = (MIB_TABLE_RTPPROFILEDATA_T *)pNewRow;

    OMCI_LOG(OMCI_LOG_LEVEL_DBG, "Start %s...", __FUNCTION__);
#if 0
    INT32 i;
    UINT32 chid;
    UINT32 proxy = 0;

   	mibRtpProfileData.EntityId = pMibRtpProfileData->EntityId;
	const UINT32 entity_id = pMibRtpProfileData->EntityId;

	// VoIP voice CTP 9.9.4
	MIB_TABLE_VOIPVOICECTP_T mibVoIPVoiceCtp, *pMibVoIPVoiceCtp;

	// VoIP media profile 9.9.5
	MIB_TABLE_VOIPMEDIAPROFILE_T mibVoIPMediaProfile, *pMibVoIPMediaProfile;

	// find channel id
	if( (MIB_GetFirst(MIB_TABLE_VOIPVOICECTP_INDEX, &mibVoIPVoiceCtp , sizeof(MIB_TABLE_VOIPVOICECTP_T)))==GOS_OK ){
		if( (MIB_GetFirst(MIB_TABLE_VOIPMEDIAPROFILE_INDEX, &mibVoIPMediaProfile, sizeof(MIB_TABLE_VOIPMEDIAPROFILE_T)))==GOS_OK ){
			if( mibVoIPMediaProfile.RTPProfilePointer == entity_id ){
				chid = mibVoIPVoiceCtp.PPTPPointer;
			}
			while( (MIB_GetNext(MIB_TABLE_VOIPMEDIAPROFILE_INDEX, &mibVoIPMediaProfile, sizeof(MIB_TABLE_VOIPMEDIAPROFILE_T)))==GOS_OK ){
				if( mibVoIPMediaProfile.RTPProfilePointer == entity_id ){
					chid = mibVoIPVoiceCtp.PPTPPointer;
				}
			}
		}
		while( (MIB_GetNext(MIB_TABLE_VOIPVOICECTP_INDEX, &mibVoIPVoiceCtp , sizeof(MIB_TABLE_VOIPVOICECTP_T)))==GOS_OK ){
			if( (MIB_GetFirst(MIB_TABLE_VOIPMEDIAPROFILE_INDEX, &mibVoIPMediaProfile, sizeof(MIB_TABLE_VOIPMEDIAPROFILE_T)))==GOS_OK ){
				if( mibVoIPMediaProfile.RTPProfilePointer == entity_id ){
					chid = mibVoIPVoiceCtp.PPTPPointer;
				}
				while( (MIB_GetNext(MIB_TABLE_VOIPMEDIAPROFILE_INDEX, &mibVoIPMediaProfile, sizeof(MIB_TABLE_VOIPMEDIAPROFILE_T)))==GOS_OK ){
					if( mibVoIPMediaProfile.RTPProfilePointer == entity_id ){
						chid = mibVoIPVoiceCtp.PPTPPointer;
					}
				}
			}
		}
	}
	else{
		ODBG_R("find chid wrong\n");
	}

	// check channel id
	if( chid > gInfo.devCapabilities.potsPortNum ){
		ODBG_R("find chid wrong. chid = %u\n" , chid);
		return GOS_FAIL;
	}
	else{
		ODBG_Y("chid = %u\n" , chid);
	}

	voipCfgPortParam_t *pCfgPort = NULL;
	pCfgPort = &g_pShareCfgVoIP->ports[chid];	// assign config pointer
#endif
    switch (operationType){
    case MIB_ADD:
    	OMCI_LOG(OMCI_LOG_LEVEL_DBG,"RTPProfileData --> ADD");
    	break;
    case MIB_SET:
    	OMCI_LOG(OMCI_LOG_LEVEL_DBG,"RTPProfileData --> SET");
    	break;
        #if 0 // not need
    case MIB_GET:
    	OMCI_LOG(OMCI_LOG_LEVEL_DBG,"RTPProfileData --> GET");

		MIB_Get(tableIndex, &mibRtpProfileData, sizeof(mibRtpProfileData));

		if (MIB_IsInAttrSet(&attrSet , MIB_TABLE_RTPPROFILEDATA_ENTITYID_INDEX))
		{
			mibRtpProfileData.EntityId = pMibRtpProfileData->EntityId;
		}

		if (MIB_IsInAttrSet(&attrSet , MIB_TABLE_RTPPROFILEDATA_LOCALPORTMIN_INDEX))
		{
			mibRtpProfileData.LocalPortMin = pCfgPort->media_port;
		}

		if (MIB_IsInAttrSet(&attrSet , MIB_TABLE_RTPPROFILEDATA_LOCALPORTMAX_INDEX))
		{
			mibRtpProfileData.LocalPortMax = pMibRtpProfileData->LocalPortMax;
		}

		if (MIB_IsInAttrSet(&attrSet , MIB_TABLE_RTPPROFILEDATA_DSCPMARK_INDEX))
		{
			mibRtpProfileData.DSCPMark = g_pShareCfgVoIP->rtpDscp;
		}

		if (MIB_IsInAttrSet(&attrSet , MIB_TABLE_RTPPROFILEDATA_PIGGYBACKEVENTS_INDEX))
		{
			mibRtpProfileData.PiggybackEvents = pMibRtpProfileData->PiggybackEvents;
		}

		if (MIB_IsInAttrSet(&attrSet , MIB_TABLE_RTPPROFILEDATA_TONEEVENTS_INDEX))
		{
			mibRtpProfileData.ToneEvents = pMibRtpProfileData->ToneEvents;
		}

		if (MIB_IsInAttrSet(&attrSet , MIB_TABLE_RTPPROFILEDATA_DTMFEVENTS_INDEX))
		{
			mibRtpProfileData.DTMFEvents = pMibRtpProfileData->DTMFEvents;
		}

		if (MIB_IsInAttrSet(&attrSet , MIB_TABLE_RTPPROFILEDATA_CASEVENTS_INDEX))
		{
			mibRtpProfileData.CASEvents = pMibRtpProfileData->CASEvents;
		}

		if (MIB_IsInAttrSet(&attrSet , MIB_TABLE_RTPPROFILEDATA_IPHOSTCONFIGPOINTER_INDEX))
		{
			mibRtpProfileData.IPHostConfigPointer= pMibRtpProfileData->IPHostConfigPointer;
		}

		/*Update to MIB*/
		MIB_Set(tableIndex, &mibRtpProfileData, sizeof(mibRtpProfileData));

    	break;
        #endif
    case MIB_DEL:
    	OMCI_LOG(OMCI_LOG_LEVEL_DBG,"RTPProfileData --> DEL");
    	break;
    default:
    	break;
    }

    return GOS_OK;
}
GOS_ERROR_CODE mibTable_init(MIB_TABLE_INDEX tableId)
{
    gMibRTPProfileDataTableInfo.Name = "RTPProfileData";
    gMibRTPProfileDataTableInfo.ShortName = "RTPPD";
    gMibRTPProfileDataTableInfo.Desc = "RTP profile data";
    gMibRTPProfileDataTableInfo.ClassId = (UINT32)(OMCI_ME_CLASS_RTP_PROFILE_DATA);
    gMibRTPProfileDataTableInfo.InitType = (UINT32)(OMCI_ME_INIT_TYPE_OLT);
    gMibRTPProfileDataTableInfo.StdType = (UINT32)(OMCI_ME_TYPE_STANDARD);
    gMibRTPProfileDataTableInfo.ActionType = (UINT32)(OMCI_ME_ACTION_CREATE | OMCI_ME_ACTION_DELETE | OMCI_ME_ACTION_SET | OMCI_ME_ACTION_GET);
    gMibRTPProfileDataTableInfo.pAttributes = &(gMibRTPProfileDataAttrInfo[0]);

    gMibRTPProfileDataTableInfo.attrNum = MIB_TABLE_RTPPROFILEDATA_ATTR_NUM;
    gMibRTPProfileDataTableInfo.entrySize = sizeof(MIB_TABLE_RTPPROFILEDATA_T);
    gMibRTPProfileDataTableInfo.pDefaultRow = &gMibRTPProfileDataDefRow;

    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].Name = "EntityId";
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMIN_INDEX - MIB_TABLE_FIRST_INDEX].Name = "LocalPortMin";
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMAX_INDEX - MIB_TABLE_FIRST_INDEX].Name = "LocalPortMax";
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DSCPMARK_INDEX - MIB_TABLE_FIRST_INDEX].Name = "DSCPMark";
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_PIGGYBACKEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].Name = "PiggybackEvents";
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_TONEEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].Name = "ToneEvents";
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DTMFEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].Name = "DTMFEvents";
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_CASEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].Name = "CASEvents";
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_IPHOSTCONFIGPOINTER_INDEX - MIB_TABLE_FIRST_INDEX].Name = "IPHostConfigPointer";

    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "Entity ID";
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMIN_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "Local port min";
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMAX_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "Local port max";
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DSCPMARK_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "DSCP mark";
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_PIGGYBACKEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "Piggyback events";
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_TONEEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "Tone events";
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DTMFEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "DTMF events";
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_CASEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "CAS events";
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_IPHOSTCONFIGPOINTER_INDEX - MIB_TABLE_FIRST_INDEX].Desc = "IP host config pointer";

    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT16;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMIN_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT16;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMAX_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT16;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DSCPMARK_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT8;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_PIGGYBACKEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT8;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_TONEEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT8;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DTMFEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT8;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_CASEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT8;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_IPHOSTCONFIGPOINTER_INDEX - MIB_TABLE_FIRST_INDEX].DataType = MIB_ATTR_TYPE_UINT16;

    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].Len = 2;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMIN_INDEX - MIB_TABLE_FIRST_INDEX].Len = 2;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMAX_INDEX - MIB_TABLE_FIRST_INDEX].Len = 2;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DSCPMARK_INDEX - MIB_TABLE_FIRST_INDEX].Len = 1;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_PIGGYBACKEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].Len = 1;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_TONEEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].Len = 1;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DTMFEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].Len = 1;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_CASEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].Len = 1;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_IPHOSTCONFIGPOINTER_INDEX - MIB_TABLE_FIRST_INDEX].Len = 2;

    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = TRUE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMIN_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMAX_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DSCPMARK_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_PIGGYBACKEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_TONEEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DTMFEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_CASEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_IPHOSTCONFIGPOINTER_INDEX - MIB_TABLE_FIRST_INDEX].IsIndex = FALSE;

    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMIN_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMAX_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DSCPMARK_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_PIGGYBACKEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_TONEEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DTMFEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_CASEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_IPHOSTCONFIGPOINTER_INDEX - MIB_TABLE_FIRST_INDEX].MibSave = TRUE;

    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_HEX;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMIN_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_DEC;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMAX_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_DEC;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DSCPMARK_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_HEX;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_PIGGYBACKEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_DEC;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_TONEEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_DEC;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DTMFEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_DEC;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_CASEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_DEC;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_IPHOSTCONFIGPOINTER_INDEX - MIB_TABLE_FIRST_INDEX].OutStyle = MIB_ATTR_OUT_DEC;

    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_SBC;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMIN_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE | OMCI_ME_ATTR_ACCESS_SBC;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMAX_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE | OMCI_ME_ATTR_ACCESS_SBC;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DSCPMARK_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE | OMCI_ME_ATTR_ACCESS_SBC;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_PIGGYBACKEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE | OMCI_ME_ATTR_ACCESS_SBC;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_TONEEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE | OMCI_ME_ATTR_ACCESS_SBC;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DTMFEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE | OMCI_ME_ATTR_ACCESS_SBC;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_CASEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE | OMCI_ME_ATTR_ACCESS_SBC;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_IPHOSTCONFIGPOINTER_INDEX - MIB_TABLE_FIRST_INDEX].OltAcc = OMCI_ME_ATTR_ACCESS_READ | OMCI_ME_ATTR_ACCESS_WRITE;

    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMIN_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMAX_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DSCPMARK_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_PIGGYBACKEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_TONEEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DTMFEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_CASEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_IPHOSTCONFIGPOINTER_INDEX - MIB_TABLE_FIRST_INDEX].AvcFlag = FALSE;

    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_ENTITYID_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMIN_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_LOCALPORTMAX_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DSCPMARK_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_PIGGYBACKEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_TONEEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_DTMFEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_CASEVENTS_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_MANDATORY;
    gMibRTPProfileDataAttrInfo[MIB_TABLE_RTPPROFILEDATA_IPHOSTCONFIGPOINTER_INDEX - MIB_TABLE_FIRST_INDEX].OptionType = OMCI_ME_ATTR_TYPE_OPTIONAL;

    gMibRTPProfileDataDefRow.EntityId = 0;
    gMibRTPProfileDataDefRow.LocalPortMin = 50000;
    gMibRTPProfileDataDefRow.LocalPortMax = 50000;
    gMibRTPProfileDataDefRow.DSCPMark = 0x2e;
    gMibRTPProfileDataDefRow.PiggybackEvents = 0;
    gMibRTPProfileDataDefRow.ToneEvents = 0;
    gMibRTPProfileDataDefRow.DTMFEvents = 0;
    gMibRTPProfileDataDefRow.CASEvents = 0;
    gMibRTPProfileDataDefRow.IPHostConfigPointer = 0;

    memset(&gMibRTPProfileDataOper, 0x0, sizeof(MIB_TABLE_OPER_T));
    gMibRTPProfileDataOper.meOperDrvCfg = RTPProfileDataDrvCfg;
    gMibRTPProfileDataOper.meOperConnCheck = NULL;
    gMibRTPProfileDataOper.meOperDump = omci_mib_oper_dump_default_handler;
    gMibRTPProfileDataOper.meOperConnCfg = NULL;
    gMibRTPProfileDataOper.meOperAvlTreeAdd = NULL;
    gMibRTPProfileDataOper.meOperAlarmHandler = NULL;
    gMibRTPProfileDataOper.meOperTestHandler = NULL;

    MIB_TABLE_RTPPROFILEDATA_INDEX = tableId;
    MIB_InfoRegister(tableId, &gMibRTPProfileDataTableInfo, &gMibRTPProfileDataOper);
    MIB_RegisterCallback(tableId, NULL, NULL);

    return GOS_OK;
}

